SFS_NAMESVR_CPPFILE = NameSvrBusiness.cpp NameSvrMain.cpp
SFS_NAMESVR_TARGET = ../../../../bin/sfs_namesvr
TARGETS = $(SFS_NAMESVR_TARGET)
SFS_NAMESVR_OBJFILE = $(patsubst %.cpp, %.o, $(SFS_NAMESVR_CPPFILE))
CXX = g++
INC_DIR = -I../../../../3party/log4cxx/include -I../include -I../../../sutil/include -I../../../../3party/mysql/include \
		  -I../../common/include -I../../../smysql/include -I../../db/include

LIBS =  -L../../../../3party/log4cxx/lib -L../../../../3party/mysql/lib -llog4cxx -L../../../../lib -lsmysql -lsutil \
		-lsfs_dbop -lmysqlclient_r

CXXFLAGS = -g -Wall -O2

.PHONY : all

all: $(TARGETS) 

$(SFS_NAMESVR_TARGET): $(SFS_NAMESVR_OBJFILE)
	        $(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@

%.o : %.cpp
	        $(CXX) -c $(CXXFLAGS) $(INC_DIR) $< -o $@

.PHONY : clean

clean:
	        rm -f *.o $(TARGETS)
